﻿@{
    Layout = "~/_SiteLayout.cshtml";
    Page.Title = "Application Health";

    string result = string.Empty;
    
    if (IsPost)
    {
        if (Request.Form["actionButton"] == "test_email")
        {
            
            KeppelLand.Helpers.EmailHelper.SendEmail("zhixian@hotmail.com", "test email", "hello workd", false);
            KeppelLand.Helpers.EmailHelper.SendExceptionAlertEmail("hello asd");

            result = "E-mail sent.";
        }
    } // if (IsPost)
    
}

<div class="container-fluid main-content" role="main" >

    <h2>
        Diagnose Application Health
    </h2>

    <div role="tabpanel">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#test_email" aria-controls="home" role="tab" data-toggle="tab">Test E-mail</a></li>
            @*<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li>
            <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
            <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>*@
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="test_email">

                <h3>Send Test E-mail</h3>

                <form method="post">
                    <button type="submit" name="actionButton" class="btn btn-primary" value="test_email">Send Test E-mail</button>
                </form>
            
            </div>
            @*<div role="tabpanel" class="tab-pane" id="profile">...</div>
            <div role="tabpanel" class="tab-pane" id="messages">...</div>
            <div role="tabpanel" class="tab-pane" id="settings">...</div>*@
        </div>

    </div>

    <p>
        @result
    </p>

    @*@foreach (string x in System.IO.Directory.GetDirectories("C:\\"))
    {
        <p>@x</p>
    }*@
        
</div>


@section Scripts
{
    <script type="text/javascript" src="~/Scripts/kendo/2014.3.1119/kendo.ui.core.min.js"></script>
    <script type="text/javascript" src="~/Scripts/moment.js"></script>
    <script type="text/javascript" src="~/Scripts/moment-with-locales.js"></script>
    <script type="text/javascript">
    (function ($) {
        "use strict";

    }(jQuery));

    </script>
}